<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p><input type="text" value="北京市"></p>
    <p><input type="text" value="朝阳区"></p>
    <button>传参</button>
</body>
<script>
    var qq=function(a,b){
        alert(a.value)
        alert(b.value)
    }
    var input=document.getElementsByTagName('input')
    var button=document.getElementsByTagName('button')[0]
    button.onclick=function(){
        qq(input[0],input[1])
    }
</script>
</html>